/*************************************************************************
> File Name: adapter.cpp
> Author: hzy
> Created Time: 2023-08-19 14:55:00
> Description:
************************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Print : public binary_function<int, int, void>
{
public:
    void operator()(int num1, int num2) const
    {
        cout << "num1 = " << num1 << ",num2 = " << num2 << endl;
    }
};

void test01()
{
    vector<int> v;
    for (int i = 1; i <= 5; i++)
    {
        v.push_back(i * 10);
    }
    for_each(v.begin(), v.end(), bind1st(Print(), 666));
    for_each(v.begin(), v.end(), bind2nd(Print(), 999));
}

int main()
{
    test01();

    return 0;
}